/*
 * Server API
 */
package org.dbdir.api.server;

import java.io.Console;
import java.net.ServerSocket;
import java.sql.Connection;
import org.dbdir.core.AccessData;
import org.dbdir.core.datastore.db.DBManager;
import org.dbdir.core.datastore.db.SQLManager;

/**
 *
 * @author thotheolh
 */
public class Server {

    private Connection sqlConnection;
    private Server servInstance; // Server instance
    private SQLManager sql; // SQL Manager
    private DBManager db; // Database Manager
    private ServerSocket servsock; // ServerSocket
    private AccessData data; // AccessData class for safe handling of server functions
    private Console in = System.console();

    public Server() {
        initServer();
    }

    /**
     * You need to do initServer before doing any other thing. It have done that in Server() for you.
     */
    public void initServer() {
    }

    public void killServer() {
    }

    public void startTCPSession() {
    }

    public void killTCPSession() {
    }

    public void doLog() {
    }

    public void output() { // output to server console
    }

    public void netout() { //output to socket
    }

    public void doAuth() { //do authentication.
    }

    /**
     * @return the sqlConnection
     */
    public Connection getSqlConnection() {
        return sqlConnection;
    }

    /**
     * @param sqlConnection the sqlConnection to set
     */
    public void setSqlConnection(Connection sqlConnection) {
        this.sqlConnection = sqlConnection;
    }

    /**
     * @return the servInstance
     */
    public Server getServInstance() {
        return servInstance;
    }

    /**
     * @param servInstance the servInstance to set
     */
    public void setServInstance(Server servInstance) {
        this.servInstance = servInstance;
    }

    /**
     * @return the sql
     */
    public SQLManager getSql() {
        return sql;
    }

    /**
     * @param sql the sql to set
     */
    public void setSql(SQLManager sql) {
        this.sql = sql;
    }

    /**
     * @return the db
     */
    public DBManager getDb() {
        return db;
    }

    /**
     * @param db the db to set
     */
    public void setDb(DBManager db) {
        this.db = db;
    }

    /**
     * @return the servsock
     */
    public ServerSocket getServsock() {
        return servsock;
    }

    /**
     * @param servsock the servsock to set
     */
    public void setServsock(ServerSocket servsock) {
        this.servsock = servsock;
    }

    /**
     * @return the data
     */
    public AccessData getData() {
        return data;
    }

    /**
     * @param data the data to set
     */
    public void setData(AccessData data) {
        this.data = data;
    }

    /**
     * @return the in
     */
    public Console getIn() {
        return in;
    }

    /**
     * @param in the in to set
     */
    public void setIn(Console in) {
        this.in = in;
    }
}
